import req from '../api/requestType'

/**
 * 通用的POST请求接口
 * @param url
 * @param param
 * @returns {*}
 */
export const commonPost = (url, param, config) => {
  return req.post(url, param, config)
}

/**
 * 通用PUT请求接口
 * @param url
 * @param param
 * @param config
 * @returns {*}
 */
export const commonPut = (url, param, config) => {
  return req.put(url, param, config)
}

/**
 * 通用的DELETE请求接口
 * @param url
 * @param param
 * @returns {*}
 */
export const commonDelete = (url, param) => {
  return req.delete(url, param)
}

/**
 * 通用的GET请求接口
 * @param url
 * @param param
 * @returns {*}
 */
export const commonGet = (url, param) => {
  return req.get(url, param)
}

/**
 * 通用的application/octet-stream方式发送POST请求
 * @param url
 * @param params
 * @returns {*}
 */
export const commonBlobPost = (url, params) => {
  return req.blobPost(url, params)
}

/**
 * 通用的以multipart/form-data方式发送GET请求
 * @param url
 * @param params
 * @returns {*}
 */
export const commonBlobGet = (url, params) => {
  return req.blobGet(url, params)
}

/**
 * 通用的以x-www-form-urlencoded方式发送POST请求
 * @param url
 * @param params
 * @returns {*}
 */
export const formPost = (url, params) => {
  return req.formPost(url, params)
}

/**
 * 通用文件上传Post请求,并接收blob响应
 * @param url
 * @param params
 * @returns {*}
 */
export const blobFilePost = (url, params) => {
  return req.blobFilePost(url, params)
}

/**
 * 通用文件上传Post请求
 * @param url
 * @param params
 * @returns {*}
 */
export const filePost = (url, params) => {
  return req.filePost(url, params)
}
export const baseURL = req.baseURL
